getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Wed, 15 Apr 2020 04:33:16 +0000 (05:33 +0100)
committerRyan Tandy <ryan@nardis.ca>
Wed, 15 Apr 2020 04:33:16 +0000 (05:33 +0100)
commit86762eea623ba9287959948676134ed9705a9454
tree9c55e307095c3480b1ddddf7421b9cd6724bc225
parentc4c6cdc0b9adec5ef2eb2d1a858dafe0f5614256
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c